<template>
	<view class="main">
		<scroll-view :scroll-y="modalName==null" class="page" :class="modalName!=null?'show':''">
			<cu-custom bgColor="bg-yellow" :isBack="true">
				<block slot="backText">返回</block>
				<block slot="content">
					<p style="font-weight: 600;">邀请桌友</p>
				</block>
			</cu-custom>
			<view class="text-center">
				<view class="margin-left-lg margin-right-lg margin-top-xl padding-lg">
					<image src="/static/qrcode.jpg" mode="aspectFit"></image>
				</view>
				<button v-if="owner===user" style="width: 80%;" class="cu-btn line-green margin-top-lg" open-type="share">邀请好友</button>
				<button v-else style="width: 80%;" class="cu-btn line-green margin-top-lg" @click="join">立即加入</button>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				modalName: null,
				tableid: null,
				owner:null,
				user:null,
			}
		},
		onLoad() {
			uni.getNetworkType({
				success: function (res) {
					console.log(res.networkType);
				}
			});
			let _user=uni.getStorageSync('userinfo');
			this.user=_user.userid;
			const query = this.$mp.query;
			this.tableid = query.id;
			this.owner=query.owner;
		},
		methods: {
			join(){
				console.log(this.tableid+'/'+this.user)
			}
		}
	}
</script>

<style scoped>
	.main {
		background-color: white;
		height: calc(100vh);
	}
</style>